 <script language="javascript">
function carga_popup(valor)
{
	window.open('add_popup.php?section='+valor,'pop3','width=315,height=130,scrollbars=0');
}
</script>

	<table width="450" border="0" cellspacing="5" cellpadding="5" align="center">
		<tr>
			<td class="t" align="right"><a href="#" onclick="carga_popup(1);" class="t"><b>CARGAR POPUP</b></a></td>
		</tr>
		<tr>
			<td class="t" align="center"><b>Popups Activos:</b></td>
		</tr>
			<?php
			$sql_query = "select id, popup, section from popups where estado = 0 order by section";
			$sql_query_execute = mysql_query($sql_query, $conn);
			$rows_number = mysql_num_rows($sql_query_execute);
			if ($rows_number == 0)
			{
			?>
		<tr>
			<td class="t" align="center"><b>No hay popups cargados</b></td>
		</tr>
			<?
			} else {
			for($i=0; $i<$rows_number; $i++)
			{
				$row = mysql_fetch_array($sql_query_execute);
			?>
		<tr>
			<td class="t" align="center">
			<?
			$id = $row['id'];
			$popup = $row['popup'];
			$ext = explode(".", $popup);
			$extension = strtolower($ext[count($ext)-1]);
			if($extension == 'swf')
			{
			?>
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="200">
				<param name=movie value="../img/popups/<?=$popup?>">
				<param name=quality value=high>
				<embed src="../img/popups/<?=$popup?>" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="200"></embed>
			</object>
			<?
			}else{
			?>
			<img src="../img/popups/<?=$popup?>" width="200">
			<?
			}
			?>
			<br><a href="?page=Popup&action=Delete&popup_id=<?=$id?>" class="t">Eliminar</a>
			</td>
		</tr>
		<?
		}
		}
		?>
	</table>
